﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LL.Data
{
    /// <summary>
    /// 数据库会话工厂
    /// </summary>
    public interface IDbSessionFactory
    {
        /// <summary>
        /// 返回新数据库会话实例
        /// </summary>
        /// <remarks>使用配置的默认数据库连接</remarks>
        /// <remarks>默认不使用事务</remarks>
        IDbSession NewSession(bool keepAlive = false);

        /// <summary>
        /// 返回新数据库会话实例
        /// </summary>
        /// <remarks>默认不使用事务</remarks>
        /// <param name="connectionName">数据库连接名称</param>
        IDbSession NewSession(string connectionName, bool keepAlive = false);
    }
}
